<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><{$site_title}>管理中心</title>
<{include file="js.html"}>
<script type="text/javascript" src="swfupload/jquery.min.js"></script>
<script type='text/javascript' src='swfupload/jquery-ui.min.js'></script>
<script type="text/javascript" src="swfupload/swfupload.js"></script>
<script type="text/javascript" src="swfupload/swfupload.queue.js"></script>
<script type="text/javascript" src="swfupload/fileprogress.js"></script>
<script type="text/javascript" src="swfupload/handlers.js"></script>
<style type="text/css">
#module_list{height: 490px; float: left; overflow: auto;position: relative; display: block;}
.modules{float:left; width:170px; height:170px; margin:10px; border:1px solid #acc6e9; background:#e8f5fe;}
.m_title img{width:170px; height:140px;}
.m_title{z-index: 1;}
.deleteImg{
	margin-top: -22px;  z-index: 2; margin-left:115px; _margin-left:30px; *+margin-left:30px;float:left; display:block;
	background: #000; line-height: 20px;position: absolute; width: 50px; padding-left:4px;
}
.deleteImg a{
	text-decoration: none; color:#fff;
}
</style>
<script type="text/javascript">
$(function(){
	$(".m_title").bind('mouseover',function(){
		$(this).css("cursor","move")
	});
	
	var $list = $("#module_list");
	
	$list.sortable({
		opacity: 0.6,
		revert: true,
		cursor: 'move',
		handle: '.m_title',
		update: function(){
			var sort = '0';
			$(".modules").each(function(){
				sort++;
				var img_id = $(this).attr("img_id");
				$.ajax({
					type: "post",
					url: "service_album.php?action=sort",
					data: {sort:sort,img_id:img_id},
					beforeSend: function() {
					},
					success: function(msg) {
					}
				});
			})
		}
	});
	
	$(".delImg").live('click',function(){
		var img_id = $(this).parent().parent().attr('img_id');
		$.post(
			'service_album.php?action=delImg',
			{img_id:img_id},
			function(data){
				if(data=='1')$(".modules:[img_id="+img_id+"]").remove();
			}
		)
	})
});

var swfu;
window.onload = function() {
	var settings = {
		flash_url : "swfupload/swfupload.swf",
		upload_url: "service_album.php?id=<{$id}>",
		post_params: {"PHPSESSID" : "<?php echo session_id(); ?>"},
		file_size_limit : "1024 MB",
		file_types : "*.*",
		file_types_description : "All Files",
		file_upload_limit : 100,
		file_queue_limit : 0,
		custom_settings : {
			progressTarget : "fsUploadProgress",
			cancelButtonId : "btnCancel"
		},
		file_post_name: "imgs",
		debug: false,
		
		// Button settings
		button_image_url: "images/XPButtonUploadText_61x22.png",
		button_width: "61",
		button_height: "22",
		button_placeholder_id: "spanButtonPlaceHolder",
		button_text: '<span class="theFont"></span>',
		button_text_style: ".theFont { font-size: 16; }",
		button_text_left_padding: 12,
		button_text_top_padding: 3,
		
		// The event handler functions are defined in handlers.js
		file_queued_handler : fileQueued,
		file_queue_error_handler : fileQueueError,
		file_dialog_complete_handler : fileDialogComplete,
		upload_start_handler : uploadStart,
		upload_progress_handler : uploadProgress,
		upload_error_handler : uploadError,
		upload_success_handler : uploadSuccess,
		upload_complete_handler : uploadComplete,
		queue_complete_handler : queueComplete	// Queue plugin event
	};

	swfu = new SWFUpload(settings);
 };
</script>
</head>

<body>
<div class="box">
<div style="background:url(images/mainbj.jpg) repeat-x; line-height:31px; height:31px;">
<table border="0" cellpadding="0" cellspacing="0">
<tr><td width="41" align="center">
<img src="images/biao1.jpg" />&nbsp;</td>
<td><strong>当前位置</strong>：服务详情 &gt; <{$goods.title}> &gt; 相册&nbsp;</td>
</tr></table>
</div>

<{if $id!=''}>
<table class="lefttab" cellpadding="0" cellspacing="0">
<tbody>
<tr><td height="50px" class="xiugai">
<a style="float:left; margin-left:5px;" href="service_add.php?id=<{$id}>"><div class="inp2">基本信息</div></a>
<a style="float:left; margin-left:5px;" href="service_album.php?id=<{$id}>"><div class="inp2 inp">相册信息</div></a>
<a style="float:left; margin-left:5px;" href="service_comment.php?id=<{$id}>"><div class="inp2">用户评论</div></a>
&nbsp;</td>
  </tr>
</tbody></table>
<{/if}>


<table class="lefttab" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><div style="height:26px; text-align:left; line-height:26px; background:url(images/xbj1.jpg) repeat-x; border:1px solid #e9f5fa;font-weight:bold;">&nbsp;&nbsp;相册</div>
</td></tr>
<tr>
  <td>
  	<div id="module_list">
		<{foreach item=img from=$img name=img}>
		<div class="modules" img_id="<{$img.id}>">
	    	<div style="text-align:left; padding-left:10px; color:#000; font-weight:bold;"><{$smarty.foreach.img.iteration}></div>
			<div class="m_title"><img src="../upload/service/large/<{$img.img}>"/></div>
			<div class="deleteImg">
				<a href="javascript:;" class="delImg"><img src="images/laji.jpg" border="0"/></a>
			</div>
		</div>
		<{/foreach}>
	  </div>
  &nbsp;</td>
</tr>
</table>
<div class="fieldset flash" id="fsUploadProgress"></div>
<div id="divStatus">0 Files Uploaded</div>
<div>
	<span id="spanButtonPlaceHolder"></span>
	<input id="btnCancel" type="button" value="停止上传" onclick="swfu.cancelQueue();" disabled="disabled"/>
</div>

</div>
</body>
</html>